package org.datascooter.impl;

import java.sql.Connection;
import java.sql.SQLException;

import javax.sql.ConnectionPoolDataSource;
import javax.sql.DataSource;

import org.datascooter.inface.IContextConnector;
import org.datascooter.inface.IDataSource;

public class DummyConnector implements IContextConnector {

	private final DataSource source;
	private org.datascooter.impl.DataSource ds;

	public DummyConnector(javax.sql.DataSource source, org.datascooter.impl.DataSource dsIn) {
		this.source = source;
		ds = dsIn;
	}

	@Override
	public String getContextId() {
		return ds.getContextId();
	}

	@Override
	public Connection getConnection() throws SQLException {
		return source.getConnection();
	}

	@Override
	public boolean isSupportPagination() {
		return false;
	}

	@Override
	public IDataSource getDataSource() {
		return ds;
	}

	@Override
	public void close() {
	}

	@Override
	public ConnectionPoolDataSource getSource() {
		return null;
	}

	@Override
	public boolean isCallParameterMetadata() {
		return false;
	}

	@Override
	public void setDataSource(IDataSource dataSource) throws SQLException {
	}
}
